//
//  HomeHeaderView.m
//  智慧小区
//
//  Created by lab603 on 15/6/29.
//  Copyright (c) 2015年 Dreamsoul. All rights reserved.
//

#import "HomeHeaderView.h"
#import "SDCycleScrollView.h"
@implementation HomeHeaderView
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //创建轮播器
        SDCycleScrollView *cycleScrollView = [[SDCycleScrollView alloc] init];
        cycleScrollView.userInteractionEnabled = YES;
        cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight;
        [self addSubview:cycleScrollView];
        self.cycleScrollView = cycleScrollView;
    }
    return self;
}
- (void)setPictureArray:(NSArray *)pictureArray{
    _pictureArray = pictureArray;
    //设置轮播器的frame
    CGFloat cycleX = 0;
    CGFloat cycleY = 0;
    CGFloat cycleW = [UIScreen mainScreen].bounds.size.width;
    CGFloat cycleH = ScreenWidth*0.55;
    self.cycleScrollView.frame = CGRectMake(cycleX, cycleY, cycleW, cycleH);
    //设置轮播器的数据
    self.cycleScrollView.imageURLStringsGroup = pictureArray;
    //设置自动轮转的时间
    self.cycleScrollView.autoScrollTimeInterval = 3.0;
    //自定义分页控制小圆标的颜色
    [self.cycleScrollView setDotColor:APP_THEME_COLOR];
}
- (void)setTextArray:(NSArray *)textArray{
    _textArray = textArray;
    self.cycleScrollView.titlesGroup = self.textArray;
}
@end
